﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FilesSearch.aspx.cs" Inherits="PPAP.Web.SearchReport.FilesSearch" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagPrefix="cc1" Namespace="PPAP.WebControls" Assembly="PPAP.WebControls" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../Common/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>
<body>
    <form id="Form1" runat="server">
    <div>
    <font size='-1' color='gray'>Current position:Search>>Files search</font>
        <table width="800px" style="border-color: #2A48CE; border: 1px; border-style: solid;
            border-color: Gray; border-spacing: 0px;">
            <tr style="height: 32px;">
                <td style="font-weight: bold;" bgcolor="#D7D7D7" colspan="4">
                    &nbsp;
                    Files
                </td>
            </tr>
            <tr>
                <td style="width:12%; font-weight: bold; color: #2E8AC5;">
                    &nbsp;
                    PPAR No.:
                </td>
                <td>
                    <asp:TextBox ID="txtPPARNo" autocomplete="off"  runat="server"></asp:TextBox>
                </td>
                <td style="width:12%; font-weight: bold; color: #2E8AC5;">
                    Part No.:
                </td>
                <td>
                    <cc1:PartNo ID="txtPartNo" runat="server" />
                </td>
            </tr>
            <tr><td style="width:12%; font-weight: bold; color: #2E8AC5;">&nbsp; Part name:</td><td>
                    <asp:TextBox ID="txtPartName" autocomplete="off"  runat="server"></asp:TextBox>
                </td><td style="width:12%; font-weight: bold; color: #2E8AC5;">Color:</td><td>
                    <asp:TextBox ID="txtColor" autocomplete="off"  runat="server"></asp:TextBox>
                </td></tr>
            <tr>
                <td style="width:12%; font-weight: bold; color: #2E8AC5;">
                    &nbsp;
                    Start date:
                </td>
                <td>
                    <asp:TextBox ID="txtStart" autocomplete="off"  onclick="WdatePicker();" runat="server"></asp:TextBox>
                </td>
                <td style="width:12%; font-weight: bold; color: #2E8AC5;">
                    End date:
                </td>
                <td>
                    <asp:TextBox ID="txtEnd" autocomplete="off"  onclick="WdatePicker();" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width:12%; font-weight: bold; color: #2E8AC5;">
                    &nbsp;
                    Created by:
                </td>
                <td>
                    <asp:TextBox ID="txtUser" autocomplete="off"  runat="server"></asp:TextBox>
                </td>
                <td style="width:12%; font-weight: bold; color: #2E8AC5;">
                    File type:
                </td>
                <td>
                    <asp:DropDownList ID="DropDownList1" runat="server" Width="153px">
                        <asp:ListItem>All</asp:ListItem>
                        <asp:ListItem>Attachment</asp:ListItem>
                        <asp:ListItem>Decisions</asp:ListItem>
                        <asp:ListItem>Inspection</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr style="height:32px;">
                <td align="left" colspan="2">
                    &nbsp;
                </td>
                <td align="center">
                    &nbsp;
                </td>
                <td align="right" style="padding-right: 30px;">
                    <asp:Button ID="btnSubmit" CssClass="button" runat="server" Text="Search" OnClick="btnSubmit_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnExport" CssClass="button" runat="server" Text="Export" OnClick="btnExport_Click" />
                </td>
            </tr>
        </table>
        <br />
        <asp:DataGrid ID="dgList" HeaderStyle-BackColor="#2E8AC5" HeaderStyle-Font-Bold="true"
            HeaderStyle-Height="32px" Width="100%" AllowSorting="true" OnLoad="dgLoad" AutoGenerateColumns="False"
            runat="server" onsortcommand="dgList_SortCommand">
            <Columns>
                <asp:BoundColumn DataField="rownum" HeaderText="No." FooterText="No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:TemplateColumn HeaderText="Attach.type" FooterText="Attach.type" SortExpression="ATTACHMENTTYPE" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("ATTACHMENTTYPE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Created by" FooterText="Created by" SortExpression="UPBY" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%#Eval("UPBY") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Upload time" FooterText="Upload time" SortExpression="uptime" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%#Eval("uptime").ToString()==""?"":DateTime.Parse(Eval("uptime").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="PPAR No." FooterText="PPAR No." SortExpression="PPARNO" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Eval("PPARNO") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Part No." FooterText="Part No." SortExpression="bdntpartno" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label8" runat="server" Text='<%# Eval("bdntpartno") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Part name" FooterText="Part name" SortExpression="bdntpartname" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label9" runat="server" Text='<%# Eval("bdntpartname") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Color" FooterText="Color" SortExpression="color" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label10" runat="server" Text='<%# Eval("color") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Type" FooterText="Type" SortExpression="filetype" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%#Eval("filetype") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Size" FooterText="Size" SortExpression="filesize" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%# Eval("filesize") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="IsDelete" FooterText="IsDelete" SortExpression="isdelete" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Labe20" runat="server" Text='<%# Eval("isdelete").ToString()=="1"?"Yes":"No" %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Link" FooterText="Link" SortExpression="F_URL" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <a href='<%# GetLink(Eval("F_URL").ToString()) %>' style="display: none;" target="_blank">
                            <span style="color: Blue;">
                                <%# Eval("F_Filename")%></span></a>
                        <asp:LinkButton ID="LinkButton3" Visible="true" Text='<%# Eval("F_URL").ToString().Length>14?Eval("F_URL").ToString().Substring(14,Eval("F_URL").ToString().Length-14):Eval("F_URL") %>' ToolTip='<%# Eval("F_URL") %>' runat="server"
                            OnClick="LinkButton2_Click"><%# Eval("F_Filename")%></asp:LinkButton>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateColumn>
            </Columns>
            <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" Height="32px"></HeaderStyle>
        </asp:DataGrid>
        <webdiyer:AspNetPager ID="AspNetPager2" runat="server" CssClass="paginator"
            ShowPageIndexBox="Always" PageIndexBoxType="DropDownList" TextBeforePageIndexBox="goto"
            HorizontalAlign="Center" PageSize="20" EnableTheming="true" AlwaysShow="True"
            FirstPageText="|&lt;" LastPageText="&gt;|" NextPageText="&gt;" PrevPageText="&lt;"
            SubmitButtonText="Go" TextAfterPageIndexBox="page" InvalidPageIndexErrorMessage="Page index is not effective numerical！"
            OnPageChanged="AspNetPager2_PageChanged" PageIndexOutOfRangeErrorMessage="Page index beyond range"
            BackColor="#E7E8E8">
        </webdiyer:AspNetPager>
    </div>
    </form>
</body>
</html>
